export const getData = (() => {
	let dottedBase = +new Date();
	const barDataSource : any[] = [];
	const barMultiData : any[] = [];
	const barLineData : any[] = [];

	for (let i = 0; i < 20; i++) {
		let obj = { name: '', value: 0 };
		const date = new Date((dottedBase += 1000 * 3600 * 24));
		obj.name = [date.getFullYear(), date.getMonth() + 1, date.getDate()].join('-');
		obj.value = Math.random() * 200;
		barDataSource.push(obj);
	}

	for (let j = 0; j < 2; j++) {
		for (let i = 0; i < 20; i++) {
			let obj = { name: '', value: 0, type: 2010 + j + '' };
			const date = new Date(dottedBase + 1000 * 3600 * 24 * i);
			obj.name = [date.getFullYear(), date.getMonth() + 1, date.getDate()].join('-');
			obj.value = Math.random() * 200;
			barMultiData.push(obj);
		}
	}
	const pieData = [
		{ value: 335, name: '客服电话' },
		{ value: 310, name: '奥迪官网' },
		{ value: 234, name: '媒体曝光' },
		{ value: 135, name: '质检总局' },
		{ value: 105, name: '其他' },
	];
	const radarData = [
		{ value: 75, name: '政治', type: '文综', max: 100 },
		{ value: 65, name: '历史', type: '文综', max: 100 },
		{ value: 55, name: '地理', type: '文综', max: 100 },
		{ value: 74, name: '化学', type: '文综', max: 100 },
		{ value: 38, name: '物理', type: '文综', max: 100 },
		{ value: 88, name: '生物', type: '文综', max: 100 },
	];
	for (let j = 0; j < 2; j++) {
		for (let i = 0; i < 15; i++) {
			let obj = { name: '', value: 0, type: 2010 + j + '', seriesType: j >= 1 ? 'line' : 'bar' };
			const date = new Date(dottedBase + 1000 * 3600 * 24 * i);
			obj.name = [date.getFullYear(), date.getMonth() + 1, date.getDate()].join('-');
			obj.value = Math.random() * 200;
			barLineData.push(obj);
		}
	}
	return { barDataSource, barMultiData, pieData, barLineData, radarData };
})();
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import dayjs from "dayjs";
export const formSchema : FormSchema[] = [
	{
		label: '字典标签',
		field: 'dictTags',
		component: 'JDictSelectTag',
		componentProps: {
			//字典code配置，比如通过性别字典编码：sex，也可以使用demo,name,id 表名,名称,值的方式
			dictCode: 'statistics_data_echart',
			//支持radio(单选按钮)、radioButton(单选按钮 btn风格)、select(下拉框)
			type: 'list'
		},
	},
	{
		label: '日期范围',
		field: 'dateRangeSelect',
		component: 'RangeDate',
		componentProps: {
			//日期格式化
			format: 'YYYY/MM/DD',
			//范围文本描述用集合
			placeholder: ['请选择开始日期', '请选择结束日期']
		},
	},
	{
		label: '周选择',
		field: 'monthSelect',
		component: 'weekSelect',
		componentProps: {
			size: 'small',
		},
	},
	{
		label: '月份选择',
		field: 'monthSelect',
		component: 'MonthPicker',
		show: false,
		componentProps: {
			//不可选择日期
			disabledDate: (currentDate) => {
				let date = dayjs(currentDate).format('YYYY-MM');
				let nowDate = dayjs(new Date()).format('YYYY-MM');
				//当天不可选择
				if (date == nowDate) {
					return true;
				}
				return false;
			}
		},
	},
	{
		label: '日期选择',
		field: 'dateSelect',
		component: 'DatePicker',
		componentProps: {
			//日期格式化，页面上显示的值
			format: 'YYYY-MM-DD',
			//返回值格式化（绑定值的格式）
			valueFormat: 'YYYY-MM-DD',
			//是否显示今天按钮
			showToday: true,
			//不可选择日期
			disabledDate: (currentDate) => {
				let date = dayjs(currentDate).format('YYYY-MM-DD');
				let nowDate = dayjs(new Date()).format('YYYY-MM-DD');
				//当天不可选择
				if (date == nowDate) {
					return true;
				}
				return false;
			}
		},
	}

]